package com.sa07.ui.listener;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;

import javax.swing.JEditorPane;
import javax.swing.JFrame;

public class SystemHelpActionListener implements ActionListener
{
    JFrame   frame;   
    JEditorPane   editorPane;   
    File   file;   
    String   str; 
	@Override
	public void actionPerformed(ActionEvent e)
	{
        file   =   new   File("config/test.html");   
        str   =   file.getAbsolutePath();   
        str   =   "file:"+str;   
        frame   =   new   JFrame("JEditPane");   
        editorPane   =   new   JEditorPane();   
        try   {   
            editorPane.setPage(str);   
        }   
        catch   (IOException   ex)   {   
            System.out.println("加载不成功！");   
            System.out.println("IOException:   "   +   ex);   
        }   
        frame.getContentPane().add(editorPane,   BorderLayout.CENTER);   
  
        frame.addWindowListener(new   WindowAdapter()   {   
            public   void   windowClosing(WindowEvent   e)   {   
//                System.exit(0);   
            }});   
            frame.setSize(200,260);   
            frame.setVisible(true);  
		
	}

}
